package com.cloud.cmt.usermanage.entity.vo;

import com.alibaba.fastjson.annotation.JSONField;
import com.cloud.cmt.usermanage.base.BaseEntity;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotBlank;

import javax.persistence.MappedSuperclass;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * 浙江卓锐科技股份有限公司 版权所有 © Copyright 2017<br>
 * 说明: <br>
 * 项目名称: cloud-maintenance <br>
 * 创建日期: 2017年10月24日 16:04 <br>
 * 作者: <a href="6492178@gmail.com">汪萌萌</a>
 */
@Data
@MappedSuperclass
@DynamicUpdate
public class EnterpriseDetailVO extends BaseEntity {
    @JsonProperty("social_credit_code")
    @JSONField(name = "social_credit_code")
    @ApiModelProperty(value = "社会信用代码", example = "123456789876543210")
    private String socialCreditCode;

    @JsonProperty("industry")
    @JSONField(name = "industry")
    @ApiModelProperty(value = "行业类型(1:酒店,2:物业)", example = "1", required = true)
    @Min(value = 1, message = "行业类型有误")
    @Max(value = 2, message = "行业类型有误")
    private Integer industry;

    @JsonProperty("enterprise_nature")
    @JSONField(name = "enterprise_nature")
    @ApiModelProperty(value = "企业性质(1:独立经营,2:连锁经营)", example = "1", required = true)
    @Min(value = 1, message = "企业性质有误")
    @Max(value = 2, message = "企业性质有误")
    private Integer enterpriseNature;

    @JsonProperty("enterprise_name")
    @JSONField(name = "enterprise_name")
    @ApiModelProperty(value = "企业名称", example = "华住酒店集团", required = true)
    @NotBlank
    private String enterpriseName;

    @JsonProperty("enterprise_province")
    @JSONField(name = "enterprise_province")
    @ApiModelProperty(value = "企业省份", example = "")
    private String enterpriseProvince;

    @JsonProperty("enterprise_city")
    @JSONField(name = "enterprise_city")
    @ApiModelProperty(value = "企业市份", example = "上海")
    private String enterpriseCity;

    @JsonProperty("enterprise_county")
    @JSONField(name = "enterprise_county")
    @ApiModelProperty(value = "企业区县", example = "普陀区")
    private String enterpriseCounty;

    @JsonProperty("enterprise_street")
    @JSONField(name = "enterprise_street")
    @ApiModelProperty(value = "企业街道门牌号", example = "虹桥路2266号")
    @NotBlank
    private String enterpriseStreet;

    @JsonProperty("organization_name")
    @JSONField(name = "organization_name")
    @ApiModelProperty(value = "机构名称", example = "汉庭酒店(武林广场店)", required = true)
    @NotBlank
    private String organizationName;

    @JsonProperty("hotel_star")
    @JSONField(name = "hotel_star")
    @ApiModelProperty(value = "酒店星级(1-6)", example = "1")
    @Min(1)
    @Max(6)
    private Integer hotelStar;

    @JsonProperty("organization_province")
    @JSONField(name = "organization_province")
    @ApiModelProperty(value = "机构省份", example = "浙江")
    private String organizationProvince;

    @JsonProperty("organization_city")
    @JSONField(name = "organization_city")
    @ApiModelProperty(value = "机构市份", example = "杭州市", required = true)
    @NotNull
    private String organizationCity;

    @JsonProperty("organization_county")
    @JSONField(name = "organization_county")
    @ApiModelProperty(value = "机构区县", example = "西湖区", required = true)
    @NotNull
    private String organizationCounty;

    @JsonProperty("organization_street")
    @JSONField(name = "organization_street")
    @ApiModelProperty(value = "机构街道门牌号", example = "体育场路426号", required = true)
    @NotBlank
    private String organizationStreet;

    @JsonProperty("contact")
    @JSONField(name = "contact")
    @ApiModelProperty(value = "联系人", example = "王哲", required = true)
    @NotBlank
    private String contact;

    @JsonProperty("email")
    @JSONField(name = "email")
    @ApiModelProperty(value = "邮箱", example = "1048808795@qq.com")
    @Email
    private String email;

    @JsonProperty("business_license")
    @JSONField(name = "business_license")
    @ApiModelProperty(value = "营业执照", example = "http://www.baidu.com/a.jpg")
    private String businessLicense;

    @JsonProperty("phone")
    @JSONField(name = "phone")
    @ApiModelProperty(value = "电话", example = "13838384384", required = true)
    @Pattern(regexp = "^((13[0-9])|(15[^4,\\D])|(17[^4,\\D])|(18[^4,\\D]))\\d{8}$", message = "手机号格式不正确")
    private String phone;
}
